﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="UserList.aspx.vb" Inherits="DusanProject.UserList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<asp:Table ID="tbl_Search" runat="server"  CssClass="tblSearch">
    <asp:TableRow>

        <asp:TableCell>
        
        Search :

        </asp:TableCell>

        <asp:TableCell>
        
        <asp:DropDownList ID="dd_Search" runat="server" Width="200px">
            <asp:ListItem Value="UserName">User Name</asp:ListItem>
            <asp:ListItem Value="FirstName">First Name</asp:ListItem>
            <asp:ListItem Value="LastName">Last Name</asp:ListItem>
        </asp:DropDownList> 
        
        </asp:TableCell>

         <asp:TableCell>
        
            <asp:TextBox ID="tb_Search" runat="server"></asp:TextBox>

        </asp:TableCell>

        <asp:TableCell HorizontalAlign="Center">
        
            <asp:Button ID="btn_Search" runat="server" Text="Search" />

        </asp:TableCell>

    </asp:TableRow>
    </asp:Table>
  
    
    <p>
    </p>

    <asp:GridView ID="gw_list" runat="server" AllowSorting="True" 
            AutoGenerateColumns="False" DataKeyNames="ID" 
            DataSourceID="SqlDataSource1" Width="500px" CssClass="addTable" CellPadding="5" 
            CellSpacing="5">
        <Columns>
            <asp:BoundField DataField="UserName" HeaderText="User Name" 
                SortExpression="UserName" />
            <asp:BoundField DataField="FirstName" HeaderText="First Name" 
                SortExpression="FirstName" />
            <asp:BoundField DataField="LastName" HeaderText="Last Name" 
                SortExpression="LastName" />
            <asp:TemplateField HeaderText="Picture" SortExpression="Picture">
                <ItemTemplate>
                <a href="User.aspx?UserName=<%#Eval("UserName") %>"><img alt="<%#Eval("UserName")%>" src="<%#Eval("Picture")%>" style="width:75px;height:75px" /></a>
                </ItemTemplate>
                </asp:TemplateField>
            <asp:CheckBoxField DataField="Active" HeaderText="Active" />
        </Columns>
    </asp:GridView>

        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:dbDusanCS %>" 
            ProviderName="<%$ ConnectionStrings:dbDusanCS.ProviderName %>" 
            SelectCommand="SELECT [ID], [UserName], [FirstName], [LastName], [Active], [Picture] FROM [Users]">
        </asp:SqlDataSource>


        <br />


</asp:Content>
